/*
 * StatusForm.java
 *
 * Created on 10 Июнь 2007 г., 13:26
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

// #sijapp cond.if protocols_MRIM is "true" #
// #sijapp cond.if modules_XSTATUSES is "true" #
package jimm.forms;

import javax.microedition.lcdui.*;
import jimm.ui.form.*;
import protocol.mrim.*;

/**
 *
 * @author vladimir
*/
public class MrimXStatusForm extends SomeXStatusForm implements FormListener {
    private GraphForm form;
    private static final int OPTION_XTRAZ_TITLE = 10;
    private static final int OPTION_XTRAZ_DESC  = 11;

    public MrimXStatusForm(Mrim protocol) {
        super(protocol);        
    }
    
    private void showXtrazForm() {
        int id = xstatus;
        form = new GraphForm("set_xstatus", "save", "back", this);
        form.addTextField(OPTION_XTRAZ_TITLE, "xtraz_title",
                xst_titles[id], 32, TextField.ANY);
        form.addTextField(OPTION_XTRAZ_DESC, "xtraz_desc", 
                xst_descs[id], 64, TextField.ANY);
        form.show();
    }

    public void formAction(GraphForm form, boolean apply) {
        if (apply) {
            setXStatus(form.getTextFieldValue(OPTION_XTRAZ_TITLE),
                    form.getTextFieldValue(OPTION_XTRAZ_DESC));
        }
        back();
    }

    protected void onStatusSelected() {
        showXtrazForm();
    }
}
// #sijapp cond.end #
// #sijapp cond.end #
